#include <QtCore/QCoreApplication>

#include "includes/controller/ServidorAplicacao.h"
#include <QString>
#include <QDebug>

int main( int argc, char *argv[] )
{
	QCoreApplication *a = new QCoreApplication( argc, argv );

	const short int porta = 8763;
	const QString host = "127.0.0.1";

	controller::ServidorAplicacao *server = new controller::ServidorAplicacao( host, porta );

	server->connect( server, SIGNAL(terminateApp()), a, SLOT(quit()));

	try
	{
		server->iniciar();
	} catch( QString *m )
	{
		qDebug() << *m;
		delete m;
	}

	return a->exec();
}
